package com.bwc.aidemo.base

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding

abstract class BaseActivity <VDB : ViewDataBinding>: AppCompatActivity(){
    protected lateinit var dataBinding :VDB
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        dataBinding = DataBindingUtil.setContentView(this, getLayoutId())
        initViews()
        initData()
    }

    protected abstract fun getLayoutId(): Int
    // 抽象方法：初始化视图
    protected abstract fun initViews()

    // 抽象方法：初始化数据
    protected abstract fun initData()
}